﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BGM_Project_Expense_Plan.aspx.cs" Inherits="KPIS.GERP.GBMS.APP_UI.Form.BGM_Project_Expense_Plan" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ Register src="../Controls/Combo/SourceCombo.ascx" tagname="Source" tagprefix="uc5" %>
<%@ Register src="../Controls/Combo/ExpenseCombo.ascx" tagname="Expense" tagprefix="uc6" %>


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <title><asp:Literal runat="Server" id="litTitle"/></title>
</head>
<body>
    <form id="form1" runat="server">
    <link rel="StyleSheet" href="../../Styles/StyleSheet.css" type="text/css">
    
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager> 
        
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="Grid_t4">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="panelGrid_t4" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="PanelAddEdit_t4" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnEdit_t4">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="panelGrid_t4" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="PanelAddEdit_t4" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnCancel_t4">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="panelGrid_t4" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="PanelAddEdit_t4" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>    
 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None"  > 
        </telerik:RadAjaxLoadingPanel>

        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">

                function isNumberKey(event) 
                {
                 var charCode = (event.which) ? event.which : event.keyCode
                 if(charCode > 31 && (charCode < 48 || charCode > 57)){
                     return false;
                  }
                 return true;
                }

                function onTextChange(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                } 

        </script>
    </telerik:RadCodeBlock>
    
    <div class="bigModuleFull900">
        <div class="bigModuleBottom900">
            <div class="defaultFont">

            <asp:Panel ID="panel9" runat="server" Width="840px" Height="390px" ScrollBars="Auto">
            <asp:Label ID="lbProjSeq" runat="server" Visible="False"></asp:Label>
            <asp:Label ID="lblMonthType" runat="server" Visible="False"></asp:Label>
            <asp:Label ID="lblTotalAmount" runat="server" Visible="False"></asp:Label>
            <table cellpadding="0" cellspacing="0" style="width: 98%;font-family: 'Segoe UI'; font-size: 13px">
                <tr valign="top">
                    <td align="center">
                        <asp:Panel ID="panelGrid_t4" runat="server" Visible="true">
                            <table width="95%">
                                <tr>
                                    <td align="left" valign="top" bgcolor="#7DA5E0" 
                                        style="padding: 5px; color: #FFFFFF; font-weight: bold;font-family: 'Segoe UI'; font-size: 13px">
                                        ขั้นตอนที่ 1 : เลือกค่าใช้จ่ายจากตาราง
                                    </td>
                                </tr>
                            </table>
                            <br />
                            <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="Grid_t4" runat="server" AllowMultiRowSelection="True" 
                                AllowPaging="True" AutoGenerateColumns="False" GridLines="None" PageSize="100"
                                MasterTableView-GridLines="None" OnItemCommand="Grid_t4_ItemCommand" 
                                onitemdatabound="Grid_t4_ItemDataBound" Width="770px" Visible="true">
                                <mastertableview datakeynames="Sequence" grouploadmode="Client" Width="100%" NoDetailRecordsText="... ไม่มีข้อมูล ...">
                                <Columns>
                                    <telerik:GridEditCommandColumn ButtonType="ImageButton" EditText="คลิกเพื่อแก้ไขข้อมูล">
                                        <ItemStyle Width="30px" />
                                        <HeaderStyle Width="30px" />
                                    </telerik:GridEditCommandColumn>
                                    <telerik:GridTemplateColumn Visible="false">
                                        <ItemTemplate>
                                            <asp:Label ID="lbProjectExpSeq" runat="server" Text='<%# Eval("bgm_prj_exp_seq") %>'></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" />
                                    </telerik:GridTemplateColumn> 
                                    <telerik:GridBoundColumn DataField="bgm_exp_name"
                                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" 
                                        HeaderText="ค่าใช้จ่าย" ItemStyle-HorizontalAlign="Left" 
                                        UniqueName="bgm_exp_name" Visible="true">
                                        <HeaderStyle HorizontalAlign="Center" Width="280px" />
                                        <ItemStyle HorizontalAlign="Left" />
                                    </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn DataField="total_amount" 
                                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Wrap="False" HeaderText="รวม" 
                                        ItemStyle-HorizontalAlign="Right" UniqueName="total_amount" Visible="true"
                                        DataFormatString="{0:#,##0.00}" >        
                                        <HeaderStyle HorizontalAlign="Center" Width="120px" />
                                        <ItemStyle HorizontalAlign="Right" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="amount_month1" 
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" 
                                        DataFormatString="{0:#,##0.00}"   
                                        UniqueName="amount_month1" Visible="true">
                                        <HeaderStyle HorizontalAlign="Center" Width="90px" />
                                        <ItemStyle HorizontalAlign="Right" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="amount_month2" 
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" 
                                        DataFormatString="{0:#,##0.00}"
                                        UniqueName="amount_month2" Visible="true">
                                        <HeaderStyle HorizontalAlign="Center" Width="90px" />
                                        <ItemStyle HorizontalAlign="Right" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="amount_month3" 
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" 
                                        DataFormatString="{0:#,##0.00}"
                                        UniqueName="amount_month3" Visible="true">
                                        <HeaderStyle HorizontalAlign="Center" Width="90px" />
                                        <ItemStyle HorizontalAlign="Right" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="amount_month4" 
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" 
                                        DataFormatString="{0:#,##0.00}"
                                        UniqueName="amount_month4" Visible="true">
                                        <HeaderStyle HorizontalAlign="Center" Width="90px" />
                                        <ItemStyle HorizontalAlign="Right" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="amount_month5" 
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" 
                                        DataFormatString="{0:#,##0.00}"
                                        UniqueName="amount_month5" Visible="true">
                                        <HeaderStyle HorizontalAlign="Center" Width="90px" />
                                        <ItemStyle HorizontalAlign="Right" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="amount_month6" 
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" 
                                        DataFormatString="{0:#,##0.00}"
                                        UniqueName="amount_month6" Visible="true">
                                        <HeaderStyle HorizontalAlign="Center" Width="90px" />
                                        <ItemStyle HorizontalAlign="Right" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="amount_month7" 
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" 
                                        DataFormatString="{0:#,##0.00}"
                                        UniqueName="amount_month7" Visible="true">
                                        <HeaderStyle HorizontalAlign="Center" Width="90px" />
                                        <ItemStyle HorizontalAlign="Right" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="amount_month8" 
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" 
                                        DataFormatString="{0:#,##0.00}"
                                        UniqueName="amount_month8" Visible="true">
                                        <HeaderStyle HorizontalAlign="Center" Width="90px" />
                                        <ItemStyle HorizontalAlign="Right" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="amount_month9" 
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" 
                                        DataFormatString="{0:#,##0.00}"
                                        UniqueName="amount_month9" Visible="true">
                                        <HeaderStyle HorizontalAlign="Center" Width="90px" />
                                        <ItemStyle HorizontalAlign="Right" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="amount_month10" 
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" 
                                        DataFormatString="{0:#,##0.00}"
                                        UniqueName="amount_month10" Visible="true">
                                        <HeaderStyle HorizontalAlign="Center" Width="90px" />
                                        <ItemStyle HorizontalAlign="Right" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="amount_month11" 
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" 
                                        DataFormatString="{0:#,##0.00}"
                                        UniqueName="amount_month11" Visible="true">
                                        <HeaderStyle HorizontalAlign="Center" Width="90px" />
                                        <ItemStyle HorizontalAlign="Right" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="amount_month12" 
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" 
                                        DataFormatString="{0:#,##0.00}"
                                        UniqueName="amount_month12" Visible="true">
                                        <HeaderStyle HorizontalAlign="Center" Width="90px" />
                                        <ItemStyle HorizontalAlign="Right" />
                                    </telerik:GridBoundColumn>
                                </Columns>
                               <%--<groupbyexpressions>
                                    <telerik:GridGroupByExpression>
                                        <groupbyfields>
                                            <telerik:GridGroupByField FieldName="bgm_source_seq" HeaderText="" />
                                        </groupbyfields>
                                        <selectfields>
                                            <telerik:GridGroupByField FieldName="bgm_source_name" HeaderText="แหล่งเงิน : " HeaderValueSeparator="" />
                                        </selectfields>
                                    </telerik:GridGroupByExpression>
                                    <telerik:GridGroupByExpression>
                                        <groupbyfields>
                                            <telerik:GridGroupByField FieldName="bgm_exp_grp_seq" HeaderText="" />
                                        </groupbyfields>
                                        <selectfields>
                                            <telerik:GridGroupByField FieldName="bgm_exp_grp_name" HeaderText="งบรายจ่าย : " HeaderValueSeparator="" />
                                        </selectfields>
                                    </telerik:GridGroupByExpression>
                                </groupbyexpressions>--%>
                                <editformsettings editformtype="Template">
                                    <editcolumn uniquename="EditCommandColumn1">
                                    </editcolumn>
                                </editformsettings>
                                </mastertableview>
                                <clientsettings enablerowhoverstyle="true">
                                    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                    <clientevents /><selecting allowrowselect="True" />
                                </clientsettings>
                            </telerik:RadGrid>
                            <br />
                        </asp:Panel>
                    </td>
                </tr>
                <tr valign="top">
                    <td align="center" >
                        <asp:Panel ID="PanelAddEdit_t4" runat="server" Visible="false">                                            
                            <asp:HiddenField ID="hdfTotal_t4" runat="server" />
                            <table width="95%">
                                <tr>
                                    <td align="left" valign="top" bgcolor="#7DA5E0" 
                                        style="padding: 5px; color: #FFFFFF; font-weight: bold;font-family: 'Segoe UI'; font-size: 13px">
                                        ขั้นตอนที่ 2 : กรอกจำนวนเงินตามแผนการใช้จ่ายงบประมาณในแต่ละเดือน
                                    </td>
                                </tr>
                            </table>
                                                                                              
                            <br />
                            <table width="80%" style="font-family: 'Segoe UI'; font-size: 13px" >
                                <tr valign="top">
                                    <td align="right" style="padding-top: 5px;">
                                        <asp:Label ID="lblMonthT4_1" runat="server" Text="" /><br/>
                                        <telerik:RadNumericTextBox ID="txtMonthT4_1" Runat="server" MaxLength="13"  MinValue="0"></telerik:RadNumericTextBox>
                                    </td>
                                    <td align="right" style="padding-top: 5px;">
                                        <asp:Label ID="lblMonthT4_2" runat="server" Text="" /><br/>
                                        <telerik:RadNumericTextBox ID="txtMonthT4_2" Runat="server" MaxLength="13"  MinValue="0"></telerik:RadNumericTextBox>
                                    </td>
                                    <td align="right" style="padding-top: 5px;">
                                        <asp:Label ID="lblMonthT4_3" runat="server" Text="" /><br/>
                                        <telerik:RadNumericTextBox ID="txtMonthT4_3" Runat="server" MaxLength="13"  MinValue="0"></telerik:RadNumericTextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" style="padding-top: 5px;">
                                        <asp:Label ID="lblMonthT4_4" runat="server" Text="" /><br/>
                                        <telerik:RadNumericTextBox ID="txtMonthT4_4" Runat="server" MaxLength="13"  MinValue="0"></telerik:RadNumericTextBox>
                                    </td>
                                    <td align="right" style="padding-top: 5px;">
                                        <asp:Label ID="lblMonthT4_5" runat="server" Text="" /><br/>
                                        <telerik:RadNumericTextBox ID="txtMonthT4_5" Runat="server" MaxLength="13"  MinValue="0"></telerik:RadNumericTextBox>
                                    </td>
                                    <td align="right" style="padding-top: 5px;">
                                        <asp:Label ID="lblMonthT4_6" runat="server" Text="" /><br/>
                                        <telerik:RadNumericTextBox ID="txtMonthT4_6" Runat="server" MaxLength="13"  MinValue="0"></telerik:RadNumericTextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" style="padding-top: 5px;">
                                        <asp:Label ID="lblMonthT4_7" runat="server" Text="" /><br/>
                                        <telerik:RadNumericTextBox ID="txtMonthT4_7" Runat="server" MaxLength="13"  MinValue="0"></telerik:RadNumericTextBox>
                                    </td>
                                    <td align="right" style="padding-top: 5px;">
                                        <asp:Label ID="lblMonthT4_8" runat="server" Text="" /><br/>
                                        <telerik:RadNumericTextBox ID="txtMonthT4_8" Runat="server" MaxLength="13"  MinValue="0"></telerik:RadNumericTextBox>
                                    </td>
                                    <td align="right" style="padding-top: 5px;">
                                        <asp:Label ID="lblMonthT4_9" runat="server" Text="" /><br/>
                                        <telerik:RadNumericTextBox ID="txtMonthT4_9" Runat="server" MaxLength="13"  MinValue="0"></telerik:RadNumericTextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" style="padding-top: 5px; padding-bottom: 15px;">
                                        <asp:Label ID="lblMonthT4_10" runat="server" Text="" /><br/>
                                        <telerik:RadNumericTextBox ID="txtMonthT4_10" Runat="server" MaxLength="13"  MinValue="0"></telerik:RadNumericTextBox>
                                    </td>
                                    <td align="right" style="padding-top: 5px; padding-bottom: 15px;">
                                        <asp:Label ID="lblMonthT4_11" runat="server" Text="" /><br/>
                                        <telerik:RadNumericTextBox ID="txtMonthT4_11" Runat="server" MaxLength="13"  MinValue="0"></telerik:RadNumericTextBox>
                                    </td>
                                    <td align="right" style="padding-top: 5px; padding-bottom: 15px;">
                                        <asp:Label ID="lblMonthT4_12" runat="server" Text="" /><br/>
                                        <telerik:RadNumericTextBox ID="txtMonthT4_12" Runat="server" MaxLength="13"  MinValue="0"></telerik:RadNumericTextBox>
                                    </td>
                                </tr>
                            </table>
                            <table width="95%">
                                <tr>
                                    <td align="left" valign="top" bgcolor="#7DA5E0" 
                                        style="padding: 5px; color: #FFFFFF; font-weight: bold;font-family: 'Segoe UI'; font-size: 13px">
                                        ขั้นตอนที่ 3 : กดปุ่มเพื่อบันทึกการเปลี่ยนแปลงหรือยกเลิก
                                    </td>
                                </tr>
                                <tr valign="top">
                                    <td align="center" style="padding-top: 10px; padding-bottom: 15px;">
                                        <asp:Label ID="lblSeq_t4" runat="server" Visible="False"></asp:Label>
                                        <asp:Button ID="btnEdit_t4" runat="server" Text="บันทึกการเปลี่ยนแปลง" ValidationGroup="t4" onclick="btnEdit_t4_Click" />&#160;
                                        <asp:Button ID="btnCancel_t4" runat="server" Text="ยกเลิก" CausesValidation="False" onclick="btnCancel_t4_Click" />
                                    </td>
                                </tr>
                            </table>    
                        </asp:Panel>                                                    
                    </td>
                </tr>
            </table>
            </asp:Panel>                           
            </div>
        </div>
    </div>

    </form>
</body>
</html>
